package com.xinyue.start;

import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.SpringApplication;
import org.springframework.context.ApplicationContext;

/**
 * @author 王广帅
 * @version 1.0.0
 * @since 2025/3/22 20:01
 */
@Slf4j
public class AdminStartApplication {

    public static ApplicationContext run(Class<?> mainClass, String[] args) {
        try {
            return SpringApplication.run(mainClass, args);
        } catch (Throwable e) {
            log.error("启动服务异常", e);
            ServiceStartResultHandler.startFailed();
        }
        return null;
    }
}
